﻿using System;
using System.Reflection;

namespace IInject.Reflection
{
	public abstract class ReflectionWrapper<TItem> where TItem : ICustomAttributeProvider
	{
		#region Constructors

		protected ReflectionWrapper(TItem item)
		{
			WrappedItem = item;
		}

		#endregion

		#region Properties

		public abstract string Name { get; }

		public abstract Type Type { get; }

		public TItem WrappedItem { get; private set; }

		#endregion

		#region Methods

		public override int GetHashCode()
		{
			return WrappedItem.GetHashCode();
		}

		public override bool Equals(object obj)
		{
			return WrappedItem.Equals(obj);
		}

		public override string ToString()
		{
			return WrappedItem.ToString();
		}

		#endregion
	}
}
